package com.wangsir.service;

import com.wangsir.dao.AdminDao;
import com.wangsir.entity.Admin;
import jdk.nashorn.internal.ir.CallNode;

public class AdminService {
    //创建dao对象
    AdminDao adminDao = new AdminDao();
    public static void main(String[] args){
        AdminService adminService = new AdminService();
        Admin admin = adminService.getByUsername("admin");
        System.out.println(admin);
    }
    public Admin getByUsername(String username){
        //调用dao层，因为dao层是和数据库打交道的一层；
        Admin admin = adminDao.getByUsername(username);
        return admin;
    }
}
